package practice;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.util.EntityUtils;

import java.net.URI;
import java.util.UUID;

public class Main {
    public static void main(String[] args){
        String imageUrl = "https://img0.baidu.com/it/u=1832246931,968895931&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=313";
        byte[] image = ByteUtils.getFileStream(imageUrl);

        System.out.println(new ByteArrayEntity(image));

//        HttpPost post = new HttpPost();
//        post.setURI(new URI(host + imageCheckUrl));
//        post.setHeader("sid", UUID.randomUUID().toString());
//        post.setEntity(new ByteArrayEntity(image));
//
//        HttpResponse httpResponse = getHttpClient().execute(post);
//        String response = EntityUtils.toString(httpResponse.getEntity());
//
//        System.out.println(response);
    }
}
